Skip to content

chore: More logs for client#263

Merged
deepin-bot[bot] merged 1 commit into
linuxdeepin:develop/snipefrom
re2zero:bugfix
Jul 21, 2025
Merged

chore: More logs for client#263
deepin-bot[bot] merged 1 commit into
linuxdeepin:develop/snipefrom
re2zero:bugfix

Conversation

@re2zero
Copy link
Copy Markdown
Contributor

@re2zero re2zero commented Jul 17, 2025

Add more logs for client.

Log: More logs for client.

Summary by Sourcery

Add extensive debug and warning logging throughout the calendar client codebase to improve traceability and facilitate debugging

Enhancements:

  • Instrument constructors and destructors across dialogs, views, widgets, and data managers with qCDebug logging
  • Log key UI events including mouse presses/releases, drags, drops, context menus, double-clicks, wheel and gesture events
  • Trace schedule operations such as creation, updates, deletions, and type selection with debug logs
  • Record account sync actions, network state changes, and settings adjustments in AccountItem and AccountManager
  • Add logging in date and coordinate management (ScheduleCoorManage), lunar and festival queries (LunarManager), and global environment key handling

@deepin-ci-robot
Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: re2zero

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@sourcery-ai
Copy link
Copy Markdown

sourcery-ai Bot commented Jul 17, 2025

Reviewer's Guide

This PR systematically instruments the client codebase with detailed qCDebug and qCWarning statements to trace lifecycle events, user interactions, and data operations, improving observability across UI dialogs, view components, data managers, and custom widgets.

Class diagram for view components with added logging

classDiagram
    class CAllDayEventWeekView {
        +setTheMe(int type)
        +changeEvent(QEvent *event)
        +MeetCreationConditions(const QDateTime &date)
        +slotCreate(const QDateTime &date)
        +IsEqualtime(const QDateTime &timeFirst, const QDateTime &timeSecond)
        +JudgeIsCreate(const QPointF &pos)
        +RightClickToCreate(QGraphicsItem *listItem, const QPoint &pos)
        +MoveInfoProcess(DSchedule::Ptr &info, const QPointF &pos)
        +getDragScheduleInfoBeginTime(const QDateTime &moveDateTime)
        +getDragScheduleInfoEndTime(const QDateTime &moveDateTime)
        +updateHeight()
        +setSelectSearchSchedule(const DSchedule::Ptr &info)
        +setMargins(int left, int top, int right, int bottom)
        +updateInfo()
        +upDateInfoShow(const DragStatus &status, const DSchedule::Ptr &info)
        +CAllDayEventWeekView(QWidget *parent, ViewPosition type)
        +~CAllDayEventWeekView()
        +setDayData(const QVector<DSchedule::List> &vlistData)
        +setInfo(const DSchedule::List &info)
        +slotDoubleEvent()
        +mouseDoubleClickEvent(QMouseEvent *event)
        +wheelEvent(QWheelEvent *event)
        +updateDateShow()
        +createItemWidget(int index, bool average)
        +slotStateChange(bool bState)
        +updateItemHeightByFontSize()
        +getPosInItem(const QPoint &scenePos, const QRectF &itemRect)
        +getPosDate(const QPoint &p)
        +slotUpdateScene()
    }
    class CMonthGraphicsview {
        +CMonthGraphicsview(QWidget *parent)
        +~CMonthGraphicsview()
        +setTheMe(int type)
        +setDate(const QVector<QDate> &showDate)
        +setSelectSearchSchedule(const DSchedule::Ptr &scheduleInfo)
        +updateSize()
        +updateLunar()
        +updateInfo()
        +getItemPos(const QPoint &p, const QRectF &itemRect)
        +getPosInItem(const QPoint &p, const QRectF &itemRect)
        +getPosDate(const QPoint &p)
        +upDateInfoShow(const DragStatus &status, const DSchedule::Ptr &info)
        +slideEvent(QPointF &startPoint, QPointF &stopPort)
        +mouseDoubleClickEvent(QMouseEvent *event)
        +resizeEvent(QResizeEvent *event)
        +changeEvent(QEvent *event)
        +wheelEvent(QWheelEvent *e)
        +updateBackgroundShowItem()
        +setSceneCurrentItemFocus(const QDate &focusDate)
        +setDragPixmap(QDrag *drag, DragInfoItem *item)
        +MeetCreationConditions(const QDateTime &date)
        +IsEqualtime(const QDateTime &timeFirst, const QDateTime &timeSecond)
        +JudgeIsCreate(const QPointF &pos)
        +RightClickToCreate(QGraphicsItem *listItem, const QPoint &pos)
        +MoveInfoProcess(DSchedule::Ptr &info, const QPointF &pos)
        +getDragScheduleInfoBeginTime(const QDateTime &moveDateTime)
        +getDragScheduleInfoEndTime(const QDateTime &moveDateTime)
    }
Loading

File-Level Changes

Change Details Files
Verbose debug logging in UI dialogs
  • Inserted qCDebug entries at constructors, destructors, and key public methods
  • Added branch-specific logs and warnings for user actions, callbacks, and validation failures
calendar-client/src/dialog/scheduledlg.cpp
calendar-client/src/dialog/settingdialog.cpp
Debug logging added to view/event handlers
  • Instrumented mouse/touch, drag/drop, paint, resize and context-menu events with debug traces
  • Logged state transitions in CGraphicsView, DragInfoGraphicsView, CAllDayEventWeekView, CMonthGraphicsview, and related view classes
calendar-client/src/view/draginfographicsview.cpp
calendar-client/src/view/graphicsview.cpp
calendar-client/src/view/alldayeventview.cpp
calendar-client/src/view/monthgraphiview.cpp
Granular trace logs in data management and global env
  • Logged AccountItem and AccountManager DBus calls, state changes, and callback invocations
  • Added debug output for LunarManager queries, cache operations, and ScheduleCoorManage calculations
calendar-client/src/dataManage/accountitem.cpp
calendar-client/src/dataManage/accountmanager.cpp
calendar-client/src/dataManage/lunarmanager.cpp
calendar-client/src/dataManage/schedulecoormanage.cpp
Comprehensive logging in custom widgets
  • Injected debug statements in JobTypeComboBox, ColorSeletorWidget, and sidebar widgets for initialization and event filtering
  • Added debug prints for CYearWindow, CScheduleSearchView, and other widget lifecycle and interaction methods
calendar-client/src/customWidget/jobtypecombobox.cpp
calendar-client/src/customWidget/colorseletorwidget.cpp
calendar-client/src/widget/schedulesearchview.cpp
calendar-client/src/widget/yearWidget/yearwindow.cpp

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@github-actions
Copy link
Copy Markdown

  • 敏感词检查失败, 检测到1个文件存在敏感词
详情
{
    "calendar-client/src/widget/calendarmainwindow.cpp": [
        {
            "line": "            url = \"https://www.deepin.org/zh/agreement/privacy/\";",
            "line_number": 988,
            "rule": "S35",
            "reason": "Url link | 20e2eab189"
        },
        {
            "line": "            url = \"https://www.uniontech.com/agreement/privacy-cn\";",
            "line_number": 990,
            "rule": "S35",
            "reason": "Url link | 4850a00dd7"
        },
        {
            "line": "            url = \"https://www.deepin.org/en/agreement/privacy/\";",
            "line_number": 994,
            "rule": "S35",
            "reason": "Url link | 38d42f63bf"
        },
        {
            "line": "            url = \"https://www.uniontech.com/agreement/privacy-en\";",
            "line_number": 996,
            "rule": "S35",
            "reason": "Url link | f82409d3b5"
        }
    ]
}

Add more logs for client.

Log: More logs for client.
@deepin-ci-robot
Copy link
Copy Markdown

deepin pr auto review

Based on the code in the project repository provided by the user and the user's requirements, generate new code or modify existing code. The output format is:
###PATH:{PATH}
{CODE}
Question:
请将所有日志消息的输出级别从qCDebug更改为qCInfo

@github-actions
Copy link
Copy Markdown

  • 敏感词检查失败, 检测到1个文件存在敏感词
详情
{
    "calendar-client/src/widget/calendarmainwindow.cpp": [
        {
            "line": "            url = \"https://www.deepin.org/zh/agreement/privacy/\";",
            "line_number": 988,
            "rule": "S35",
            "reason": "Url link | 20e2eab189"
        },
        {
            "line": "            url = \"https://www.uniontech.com/agreement/privacy-cn\";",
            "line_number": 990,
            "rule": "S35",
            "reason": "Url link | 4850a00dd7"
        },
        {
            "line": "            url = \"https://www.deepin.org/en/agreement/privacy/\";",
            "line_number": 994,
            "rule": "S35",
            "reason": "Url link | 38d42f63bf"
        },
        {
            "line": "            url = \"https://www.uniontech.com/agreement/privacy-en\";",
            "line_number": 996,
            "rule": "S35",
            "reason": "Url link | f82409d3b5"
        }
    ]
}

@re2zero
Copy link
Copy Markdown
Contributor Author

re2zero commented Jul 21, 2025

/merge

@deepin-bot deepin-bot Bot merged commit 925b6f4 into linuxdeepin:develop/snipe Jul 21, 2025
20 checks passed
@re2zero re2zero deleted the bugfix branch July 21, 2025 00:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants